package org.mazhi.enumtype;

public enum UserType {
	
	
	INCOME("用户",0),EXPENDITURE("管理员",1),RECHARGE("vip用户",2);

	private int statusCode;
	private String statusDescription;
	
	
	private UserType( String statusDescription,int statusCode) {  
		this.statusCode = statusCode;  
		this.statusDescription = statusDescription;  
	}  
	public String getStatusDescription() {
		return statusDescription;
	}
	public void setStatusDescription(String statusDescription) {
		this.statusDescription = statusDescription;
	}
	public int getStatusCode() {
		return statusCode;
	}
	public void setStatusCode(int statusCode) {
		this.statusCode = statusCode;
	}

	public static String getStatusDescription(int statusCode) {  
		for (UserType userStatus : UserType.values()) {  
			if (userStatus.getStatusCode()== statusCode) {  
				return userStatus.statusDescription;  
			}  
		}  
		return null;  
	} 
	
	
	public static UserType getEnum(int statusCode) {  
		for (UserType userStatus : UserType.values()) {  
			if (userStatus.getStatusCode()== statusCode) {  
				return userStatus;  
			}  
		}  
		return null;  
	}
}





